/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.velocityme.session;

import com.velocityme.entity.Login;
import com.velocityme.entity.Node;
import com.velocityme.entity.Person;
import com.velocityme.entity.User;
import com.velocityme.enums.Permission;
import javax.ejb.Local;

/**
 *
 * @author rcrida
 */
@Local
public interface KeyLocal {

    public enum Success {
        SUCCESS,
        NO_AVAILABLE_LICENCE,
        INCORRECT_PASSWORD,
        INVALID_USER,
        UNKNOWN_USER,
        ERROR
    }

    Success login(final String username, final String password, final String remoteHost);

    void logout();

    boolean isValid();

    String getUsername();

    boolean getShowBookmarks();

    String getPersonName();

    User getUser();

    Login getLogin();

    void validateKey();

    void assertHasPermission(Node node, Permission permission);

    Person getPerson();
    
}
